package tr.edu.metu.is.mega.client.course.instructor.students;

import tr.edu.metu.is.mega.client.user.UserWidget;
import tr.edu.metu.is.mega.client.widgets.MegaCompositeField;
import tr.edu.metu.is.mega.common.dto.CourseDTO;

/**
 * Field for selecting person.
 */
public class TeamField extends MegaCompositeField {

    private final String boundAttribute;

    /**
     * Default constructor.
     * 
     * @param boundAttribute bound attribute
     */
    public TeamField(String boundAttribute, CourseDTO course) {
        super(new TeamWidget(course));
        this.boundAttribute = boundAttribute;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getBoundAttribute() {
        return boundAttribute;
    }

    @Override
    public void clear() {
        ((UserWidget) getWidget()).setValue(null);
    }

}
